function updateClock() {
    const now = new Date();
    const hours = now.getHours();
    const minutes = now.getMinutes();
    const seconds = now.getSeconds();
    const clockDisplay = document.getElementById('clockDisplay');
    clockDisplay.textContent = `${hours % 12}:${minutes}:${seconds < 10 ? '0' + seconds : seconds}`;

    const dateDisplay = document.getElementById('dateDisplay');
    dateDisplay.textContent = now.toLocaleDateString('en-US'); // 显示日期，格式为 MM/DD/YYYY

    const hourHand = document.querySelector('.hour-hand');
    const minuteHand = document.querySelector('.minute-hand');
    const secondHand = document.querySelector('.second-hand');
    const hourDegrees = ((hours % 12) / 12) * 360 + (minutes / 60) * 30;
    const minuteDegrees = (minutes / 60) * 360;
    const secondDegrees = (seconds / 60) * 360;

    hourHand.style.transform = `rotate(${hourDegrees}deg)`;
    minuteHand.style.transform = `rotate(${minuteDegrees}deg)`;
    secondHand.style.transform = `rotate(${secondDegrees}deg)`;
  }

  setInterval(updateClock, 1000);
  updateClock(); // 初始化时钟